#ifndef MAILER_THREAD_H
#define MAILER_THREAD_H

#include <Qt\qthread.h>
#include <Qt\qmessagebox.h>

#include "Mail.h"
#include "MailBox.h"

class ResaHotelGUI;

class MailerThread : public QThread{
	Q_OBJECT

public :
	static enum MailerState{ SEND_MAIL, LAUNCH_DEFAULT_CLIENT, SEND_OK, SEND_ERROR, LAUNCH_OK, LAUNCH_ERROR };

private :
	ResaHotelGUI* parent;
	Mail* mail;
	MailBox* mailBox;

	MailerState state;

	MailerThread(void) {}
	MailerThread(const MailerThread&) {}

public :
	MailerThread(ResaHotelGUI* _parent, Mail* _mail, MailBox* _mailBox);

	virtual ~MailerThread(void){
		//Nothing
	}

	MailerState getState(void) const { return state; }
	void setState(const MailerState& _state)  { state = _state; }
	void run();
};

#endif //MAILER_THREAD_H